package com.livi.study;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class Task implements Job {

	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		File file = new File("D://FileDemo.txt");
		try {
			if (!file.exists()) {
				file.createNewFile();
			}
			FileWriter fw = new FileWriter(file, true);
			fw.write(new Date().toString() + "\r\n");
			fw.close();
			System.out.println("done");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
